package ch.elca.lol.puissance4.player;

import ch.elca.lol.puissance4.board.Board;
import ch.elca.lol.puissance4.util.Util;

/** An AI that randomly selects a move among the valid ones. */
public class RandomAI extends PlayerHelper {
	@Override
	public int play(Board b) {
		int w = b.getWidth();
		int col = -1;
		while(!b.isPlayable(col)) {
			col = Util.random(0, w);
		}
		return col;
	}
	
	@Override
	public String toString() {
		return "HERPA DERP";
	}
}
